package com.youlai.boot.bmp.model.form;

import com.youlai.boot.form.validator.ValidJson;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;


@Schema(description = "模型表单对象")
@Data
public class BizProcessForm {

    @Schema(description = "流程定义ID，新增可以不传")
    private Long processId;

    @Schema(description = "流程BIZ分类Id")
    @NotNull(message = "流程不能为空")
    private Long categoryId;

    @Schema(description = "流程Icon")
    protected String processIcon;

    @Schema(description = "流程类型(child/main)")
    @NotBlank(message = "流程类型不能为空")
    protected String processType;

    @Schema(description = "流程唯一标识code")
    @NotBlank(message = "唯一标识key不能为空")
    private String processKey;

    @Schema(description = "流程名称")
    @NotBlank(message = "流程名称不能为空")
    private String processName;

    @Schema(description = "流程描述")
    protected String remark;

    @Schema(description = "管理人id")
    private String createId;

    @Schema(description = "管理人用户名")
    private String createBy;

    @Schema(description = "流程定义json字符串")
    @NotBlank(message = "流程定义结构JSON")
    @ValidJson(message = "流程定义结构必须是有效的JSON格式")
    private String jsonModel;


    @Schema(description = "排序字段")
    private Integer sort;

    @NotBlank(message = "表单结构JSON，描述字段组件结构不能为空")
    @ValidJson(message = "表单结构必须是有效的JSON格式")
    @Schema(description = "流程表单结构JSON，描述字段组件结构")
    private String formSchema;

}
